<?php
/**
 * Created by PhpStorm.
 * User: LiuJiaJun
 * Date: 2018/12/5
 * Time: 14:10
 */
namespace api\storage\model;

use think\db\exception\DataNotFoundException;
use think\db\exception\ModelNotFoundException;
use think\exception\DbException;
use think\Model;

class BomModel extends Model
{

    protected $table = 'iwh_bom';
    protected $pk = 'uuid';

    /**
     * 查找bom的信息
     *
     * @param array $where
     * @return array|false|\PDOStatement|string|Model
     * @throws DataNotFoundException
     * @throws DbException
     * @throws ModelNotFoundException
     * @throws \think\Exception
     */
    public function findBomInfo($where = []){
        return $this->where($where)->find();

    }


    /**
     * 添加数据
     *
     * @param $data
     * @return false|int
     */
    public function add($data){
        return $this->save($data);
    }


    public function updateBom($uuid,$data){
        return $this->isUpdate(true)->save($data,['uuid'=>$uuid]);
    }
}